home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-10-13 | 3.2 KB | 87 lines | [TEXT/MPS ] |
- (******************************************************************************
- *
- * Apple Macintosh Developer Technical Support
- *
- * Interface for the printing routines
- *
- * Program: Sample 3.0
- * FILE: Print.p - Pascal implementation
- *
- * by: Matt Deatherage
- * Based on a story by Pete 'Luke' Alexander
- *
- * Copyright © 1988-1993 Apple Computer, Inc.
- * All rights reserved.
- *
- *******************************************************************************
- *
- * This unit contains code based on Macintosh Technical Note "A Printing Loop
- * That Cares...", which shows a canonical example of how to print on the
- * Macintosh.
- *
- ******************************************************************************)
-
- UNIT PrintStuff; { printing unit based on Luke's caring print loop }
-
- INTERFACE
-
- (*******************************************************************************
- * Used Units
- *******************************************************************************)
-
- USES Resources, PrintTraps, Packages, AppleTalk, Processes, PPCToolbox, EPPC,
- Notification, AppleEvents, SampleUtilities, TrafficLights;
-
- (*******************************************************************************
- * Constants
- *******************************************************************************)
-
- CONST
-
- rPrintingError = 3000; { Alert saying there was a problem }
-
- (*******************************************************************************
- *
- * Print - make a window or Picture show up on paper
- *
- * This routine's four parameters allow it to flexibly print windows or
- * pictures, with or without PrJobMerge. The first parameter is this document's
- * print record, containing all of its user-specified options in "Page Setup."
- * The second parameter is a pointer to a window to be printed. If this
- * parameter is NIL, the third parameter must be a PicHandle (the third
- * parameter is ignored otherwise). The fourth parameter, if not NIL, is
- * merged with the first parameter using PrJobMerge. This lets us get job-
- * specific parameters once and print several documents with them.
- *
- * If the document is larger than one page, it is tiled across several pages
- * in drawing-program style.
- *
- * The returned value indicates whether or not printing was succesful.
- *
- * The second, third and fourth parameters are all ignored if NIL, but if the
- * second parameter is NIL, we'll pass the third parameter to DrawPicture.
- *
- *******************************************************************************)
-
- FUNCTION Print(thePrRecHdl: THPrint; theWindow: WindowPtr; thePict: PicHandle;
- theMergeRec: THPrint): BOOLEAN;
-
- (*******************************************************************************
- *
- * PageSetup - get document-specific formatting options from the user
- *
- * This routine asks the user to set parameters about the current document,
- * including page size, orientation and other "Page Setup..." goodies, using
- * the standard Macintosh printing dialogs. The returned value indicates
- * whether or not the user accepted the dialog or not.
- *
- *******************************************************************************)
-
- FUNCTION PageSetup(thePrRecHdl: THPrint): BOOLEAN;
-
- IMPLEMENTATION
-
- {$I print.inc1.p}
-
- END. { unit PrintStuff }
-